package cn.edu.sdjzu.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class GateWayConfig {
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
        RouteLocatorBuilder.Builder routes = builder.routes();
        routes.route("baidu-route1", r -> r.path("/**").uri("https://www.baidu.com")).build();
        //routes.route("myroute", r -> r.path("/hello").uri("http://localhost:8080")).build();
        return routes.build();
    }
}
